package com.neuedu.corejava.ch10;

import java.util.Stack;

public class StackClass {

	public static void main(String[] args) {
		
		//Stack 栈结构，FILO
		Stack<Computer>stack=new Stack<>();
		
		//压栈
		for (int i=0;i<5;i++) {
			stack.push(new Computer("hw"+i,5400+i));
		}
		
		//弹栈
		Computer computer=null;
		while((computer=stack.pop())!=null) {
			System.out.println(computer);
			if(stack.isEmpty()) {
				break;
			}
		}
	}
}
